﻿<?php
error_reporting(0);
define('IN_QY',true);
session_start();
require("include/common.inc.php");
define('SCRIPT','ad_list');
//
if(!$_COOKIE['userid']){
      echo "<script type='text/javascript'>location.href='/wap/mlogin.php';</script>";
      exit;
}

?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>闲置交易</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="/ui/xianzhi/css/style.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="/ui/xianzhi/js/jquery.min.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/slider.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/tab.js"></script>
    </head>
    <body>
        <section class="aui-flexView">
            <header class="aui-navBar aui-navBar-fixed">
                <a href="javascript:history.back(-1);" class="aui-navBar-item">
                    <i class="icon icon-return"></i>
                </a>
                <div class="aui-center">
                    <span class="aui-center-title">闲置交易</span>
                </div>
				<!-------------
                <a href="javascript:;" class="aui-navBar-item">
                    <i class="icon icon-share"></i>
                    <i class="icon icon-more"></i>
                </a>
				----------------->
            </header>
            <section class="aui-scrollView">
            <div class="aui-shop-list aui-shop-list-selected">
			
		  <?php

  	$reslut = "select count(*) as a from tbl_taospp where state=1 and goodstype=3 and typeid='".$_GET['y']."'";
  $query_reslut = mysql_query($reslut);
$row_reslut=mysql_fetch_array($query_reslut);
$count=$row_reslut['a'];
//页面数量
$page_size=3;
//总页数
$page_count = ceil($count/$page_size);
//第几页
$page=$_GET['page'];
if($page==''){
  $page=1;
}
$last=$page-1;//上一页
$next=$page+1;//下一页

//页面起始条数
$offset=$page_size*($page-1);
  
  
  
           $sql1 = "select * from tbl_taospp where  state=1 and goodstype=3 and typeid='".$_GET['y']."' order by id desc LIMIT $offset,$page_size";
           $query1 = mysql_query($sql1);
		
        if(!mysql_affected_rows()){
            echo '
                <div class="H-padding-vertical-bottom-10"></div>
                </br>
    <div class="H-channel-title H-flexbox-horizontal H-theme-background-color-white H-vertical-middle H-border-vertical-bottom-after">
        <div class="H-channel-line H-theme-background-color8 H-padding-vertical-top-15 H-padding-horizontal-left-3  H-margin-horizontal-left-10"></div>
        <div class="H-channel-text H-theme-font-color8 H-flex-item H-font-size-18 H-theme-font-color-black H-padding-10 H-margin-horizontal-right-10 H-text-show-row-1">暂无</div>
    </div>
    </br></br>
            ';
}        
        while ($row=mysql_fetch_array($query1)) {
         $a=explode(',', $row['img']);    
    ?> 
				     <?php
       $sql3 = "select * from tbl_user  where id='".$row['ggunit']."'";
        $query3=mysql_query($sql3);
		$row3=mysql_fetch_array($query3);
		 ?>
						
                        <a href="javascript:;" class="aui-shop-list-item">
                             <div class="aui-shop-list-item-hd">
                                <img src="<?php echo $a[0] ?>" alt="">
                               
                            </div>							
                            <div class="aui-shop-list-item-bd">
                                <h3><?php echo $row['chtitle'] ?></h3>
                                <p class="aui-special-text">
                                
                                    <span></span>
                                </p>
                                <p class="aui-special-etc">
                                    <span class="aui-special-etc-hd">￥598</span>
									<img src="<?php echo $row3['username'] ?>" alt="" style="width: 20px;margin-left: 25px;">
                                    <span style="margin-top: 5px;position: absolute;margin-left: 10px;font-size: 8px;float: right;"><?php echo $row3['shuyu'] ?></span>
                                </p>
                            </div>
                        </a>

                 <?php } ?>

            <?php

    if($page==1){   
	if($page_count>$page){
		
	echo "<a href='?page=".$next."'  style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>下一页</a>&nbsp;&nbsp;&nbsp;";	
	
	}
   }else
    if($page==$page_count){
      echo "&nbsp;&nbsp;<a href='?page=".$last."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>上一页</a>&nbsp;&nbsp;&nbsp;";
    }else{
      echo "&nbsp;&nbsp;<a href='?page=".$last."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>上一页</a>&nbsp;&nbsp;&nbsp;";
      echo "<a href='?page=".$next."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>下一页</a>&nbsp;&nbsp;&nbsp;"; 
    }
  ?>                   
					  
					  
					  
					  
					  
          
                    </div>				
            </section>

        </section>
    </body>
</html>
